/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Description: Tpm driver Vendor Hooks
 */

#ifdef CONFIG_VENDOR_TPM_HOOKS
#undef TRACE_SYSTEM
#define TRACE_SYSTEM tpm

#undef CONFIG_TRACEPOINTS

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_TPM_HOOKS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_TPM_HOOKS_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#include <linux/tpm.h>

DECLARE_HOOK(vendor_tpm_tee_try_transmit,
	TP_PROTO(struct tpm_chip *chip, u8 *buf, size_t bufsiz, u32 *result),
	TP_ARGS(chip, buf, bufsiz, result));

DECLARE_HOOK(vendor_tpm_flash_mutex_lock,
	TP_PROTO(unsigned int state, int *busy),
	TP_ARGS(state, busy));

#endif
/* This part must be outside protection */

#include <trace/define_trace.h>

#else

#include <linux/tracepoint.h>
#include <linux/tpm.h>


DECLARE_EVENT_NOP(vendor_tpm_tee_try_transmit,
	TP_PROTO(struct tpm_chip *chip, u8 *buf, size_t bufsiz, u32 *result),
	TP_ARGS(chip, buf, bufsiz, result));

DECLARE_EVENT_NOP(vendor_tpm_flash_mutex_lock,
	TP_PROTO(unsigned int state, int *busy),
	TP_ARGS(state, busy));

#endif
